unit FormClienteUnit;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.StdCtrls, Vcl.Mask,
  Vcl.DBCtrls, Vcl.Buttons,DataModule_Cliente;

type
  TFormCliente = class(TForm)
    Label1: TLabel;
    DBEdit1: TDBEdit;
    DataSource1: TDataSource;
    Label2: TLabel;
    DBEdit2: TDBEdit;
    Label3: TLabel;
    DBEdit3: TDBEdit;
    Label4: TLabel;
    DBEdit4: TDBEdit;
    Label5: TLabel;
    DBEdit5: TDBEdit;
    Label6: TLabel;
    DBEdit6: TDBEdit;
    Label7: TLabel;
    DBEdit7: TDBEdit;
    Label8: TLabel;
    DBEdit8: TDBEdit;
    Label9: TLabel;
    DBEdit9: TDBEdit;
    Label10: TLabel;
    DBEdit10: TDBEdit;
    Label11: TLabel;
    DBEdit11: TDBEdit;
    Label12: TLabel;
    DBEdit12: TDBEdit;
    BitBtnSalvar: TBitBtn;
    Label13: TLabel;
    DBEdit13: TDBEdit;
    Label14: TLabel;
    DBEdit14: TDBEdit;
    Label15: TLabel;
    DBEdit15: TDBEdit;
    procedure FormShow(Sender: TObject);
    procedure BitBtnSalvarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure gerarId;
  end;

var
  FormCliente: TFormCliente;

implementation

{$R *.dfm}

uses DataModule_Controle;



procedure TFormCliente.BitBtnSalvarClick(Sender: TObject);
begin
  DM_Cliente.CDSClienteATIVO.AsInteger := 1;
  DM_Cliente.CDSCliente.ApplyUpdates(0);
  MessageDlg('Cliente cadastrado com sucesso!',mtInformation,[mbOK],0);
  close;
end;

procedure TFormCliente.FormShow(Sender: TObject);
begin
  DM_Cliente.CDSCliente.Open;
  DM_Cliente.CDSCliente.Append;

  DBEdit1.Text := IntToStr(  DM_Controle.retornaID('ID_CLIENTE') );


end;

procedure TFormCliente.gerarId;
begin

end;

end.
